var $ = require('../../lib/jquery');
var util = require('./common/util');
var nav = require('./common/nav');
var _header = require('./common/header');
var template = require('../tpl/template');
var minHeight = require('./common/minHeight');
minHeight.init();
var _nav = new nav();
var header = new _header();
//疫苗详情页
var ymxq_ = {
  init: function (medicalid) {
      this.fetch();
  },
  fetch: function (medicalid) {
    var _this = this;
    util.fetch('api/vaccine/queryObject', {
      vaccineId: util.getParam('vaccineId') || 3,
      sign:'1',
    },{
      timeout:1000
    }).then(function(res){
      _this.render(res.data);
    }).fail(function(res){
      console.log('抱歉该疫苗详情尚未录入')
    })
  },
  render: function (data) {
    var tpl = template('ym_detail',{data:data})
    $('.js_after_detail').html(tpl);

  },
  bindevent: function (medicalid) {
    $('.js_index').on('click',function(){
      location.href="./index.html"
    })
    $('.js_yfjzfw').on('click',function(){
      history.back();
    })
  }
}
ymxq_.init();